package com.dominos.voldemortstress;

import voldemort.client.ClientConfig;
import voldemort.client.SocketStoreClientFactory;
import voldemort.client.StoreClient;
import voldemort.client.StoreClientFactory;

public class VoldemortStoreClientFactory implements VoldemortStoreClientMaker {

	@Override
	public  VoldemortStoreClient createStoreClient(
			ClientConfig clientConfig, String storeName) {
		
		StoreClientFactory factory;

		factory = new SocketStoreClientFactory(clientConfig);
		StoreClient<Object, Object> storeClient = factory.getStoreClient(storeName);
		
		VoldemortStoreClient voldemortStoreClient = new VoldemortSimpleStoreClient();
		voldemortStoreClient.setStoreClient(storeClient);
		voldemortStoreClient.setClientConfig(clientConfig);
		voldemortStoreClient.setStoreClientFactory(factory);
		
		return voldemortStoreClient;
	}
	
	
}
